Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: nxlog use time field as signal if missing #244

Merged
merged 1 commit into from
Oct 15, 2024
Merged

Conversation

jokasimr
Copy link
Contributor

Fixes #230

@@ -52,16 +52,14 @@ def test_nxobject_log(h5root):
assert sc.identical(log[...], da)


@pytest.mark.filterwarnings("ignore:Failed to load /entry/log:UserWarning")
def test_nxlog_with_missing_value_triggers_fallback(nxroot):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test name needs update

Comment on lines 489 to 497
fallback_signal_name='value',
)

def _init_signal(self, *args, children, **kwargs):
super()._init_signal(*args, children=children, **kwargs)
if self._signal is None:
if 'time' in children:
self._signal_name = 'time'
self._signal = children['time']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this simply use

fallback_signal_name='value' if 'value' in children else 'time'`

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's better 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But, there's no argument to _init_signal called fallback_signal_name

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My point was to change __init__ and remove _init_signal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha I see

@jokasimr jokasimr merged commit 23656d1 into main Oct 15, 2024
4 checks passed
@jokasimr jokasimr deleted the remove-warn-tdc branch October 15, 2024 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support NXlog without value dataset
2 participants